// 风格参考
// https://unocss.dev/
// https://cn.vitejs.dev/

// 文档配置
// https://vitepress.dev/reference/site-config

import { defineConfig } from 'vitepress'
export default defineConfig({
  title: "金域前端",
  description: "km-fed",
  head: [['link', { rel: 'icon', type: "image/x-icon",href: '/images/favicon.ico' }]],
  themeConfig: {
    logo: '/images/favicon.ico',
    // 导航
    nav: [
      { text: '首页', link: '/' },
      { text: '组件库', link: '/components/introduce' },
      { text: '规范', link: '/specification/design' },
      { text: '团队介绍', link: '/team' },
      { text: '相关链接',
       items: [
          {
            text: '集团IT专业委员会',
            link: 'https://docs.qq.com/sheet/DSU5SS0prYUJJaUpC?tab=BB08J2'
          }
        ]
      },
    ],
// 侧边栏
    sidebar: {
      '/components/': componentsGuide(),
      '/specification/': specificationGuide(),
    },
    search: {
      provider: 'local'
    },
    editLink: {
      pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path',
      text: '编辑此页面'
    },
    socialLinks: [
      { icon: 'github', link: 'https://gitee.com/chenchenghua/km-fed' }
    ],
    lastUpdated: {
      text: '最近更新时间',
    },
    footer: {
      copyright: 'Copyright © 2023-present 金域医学'
    },
    outlineTitle: '当前页',
    docFooter: { prev: '上一篇', next: '下一篇' }
  }
})

function componentsGuide() {
  return [
    {
      text: '总览',
      collapsible: false,
      items: [
        { text: '介绍', link: '/components/introduce' },
        { text: '编写说明', link: '/components/edit' },
      ]
    },
    {
      text: 'PC组件',
      collapsible: true,
      items: [
        { text: '水印', link: '/components/watermask' },
        {
          text: 'antd',
          collapsible: true,
          items: [
            { text: 'select', link: '/guide/markdown' },
          ]
        },
        {
          text: 'element',
          collapsible: true,
          items: [
            { text: 'select', link: '/guide/markdown' },
          ]
        },
      ]
    },
    {
      text: 'H5组件',
      collapsible: true,
      items: [
        { text: '水印', link: '/guide/markdown' },
        { text: 'drag', link: '/guide/asset-handling' },
      ]
    },
    {
      text: '小程序',
      collapsible: true,
      items: [
        { text: 'kmc-条件筛选', link: '/guide/markdown' },
      ]
    },
    {
      text: 'JS-API',
      collapsible: true,
      items: [
        { text: '深拷贝', link: '/guide/asset-handling' },
        {
          text: '树',
          collapsible: true,
          items: [
            { text: 'list转tree', link: '/guide/markdown' },
          ]
        },
        {
          text: 'URL',
          collapsible: true,
          items: [
            { text: '对象转get传参', link: '/guide/markdown' },
          ]
        }
      ]
    }
  ]
}

function specificationGuide(){
  return [{
      text: '总览',
      collapsible: false,
      items: [
        { text: '设计规范', link: '/specification/design' },
        { text: '代码约束', link: '/specification/code' },
      ]
  },{
    text: '脚手架',
    collapsible: false,
    items: [
      { text: 'pc', link: '/specification/design' },
      { text: 'h5', link: '/specification/code' },
      { text: '小程序', link: '/specification/code' },
    ]
}]
}
